package com.lanhai.javaBean;

import java.util.ArrayList;
import java.util.List;

import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;

import com.lanhai.model.CacheShelf;
import com.mybatis.dao.CacheShelfDao;

public class CacheShelfBean {

	/**
	 * 加载地标列表
	 */
	public static List<CacheShelf> loadData(SqlSessionFactory sqlSessionFactory){
		List<CacheShelf> list = new ArrayList<CacheShelf>();
		SqlSession sqlSession = sqlSessionFactory.openSession();
		try {
			CacheShelfDao dao = sqlSession.getMapper(CacheShelfDao.class);
			list = dao.selectAll();
	    }catch(Exception e){
	    	e.printStackTrace();
	    }finally{
	    	sqlSession.close();
	    }
		return list;
	}
	
}
